﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BolaoDNA.DomainModel
{
    public class Bolao
    {
        public Bolao()
        {
            this.Competicao = new Competicao();
            this.InscricoesBolao = new List<InscricaoBolao>();
        }

        virtual public int ID { get; set; }

        virtual public Competicao Competicao { get; set; }

        virtual public String Nome {get ; set;}

        virtual public Boolean Privado { get; set; }

        virtual public IList<InscricaoBolao> InscricoesBolao { get; set; }

        public void TotalizarRanking()
        {
            foreach (var inscricaoBolao in this.InscricoesBolao)
           {
                inscricaoBolao.SomarPontuacoesJogos();
            }
        }

        public override string ToString()
        {
            return this.Nome;
        }
        
    }
}
